package com.ithema.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

/**
 * @Description json转换器
 * @Author wangyu
 * @Date 2019/9/24 10:28
 */
public interface JsonConverter {

    /**
     * 普通对象转换成Json
     * @param o
     * @return
     */
    default String toJson(Object o){
        return JSON.toJSONString(o, SerializerFeature.WriteMapNullValue);
    }

}
